﻿using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SprayProcessSCADASystem.UserControls
{
    public partial class UserDeviceState : UIUserControl
    {
        public UserDeviceState()
        {
            InitializeComponent();
        }

        #region 设备状态名
        [Browsable(true)]//使属性可以暴露出来，显示到窗口中
        [Category("自定义属性")]//自定义属性
        [Description("设备状态名称")]
        private string _deviceStateName="状态名称";
        public string DeviceStateName
        {
            get { return _deviceStateName; }
            set
            {
                _deviceStateName = value; 
                this.lbl_StateName.Text = _deviceStateName;

            }
        }
        #endregion

        #region 设备状态
        private bool _deviceState;
        public bool DeviceState
        {
            get { return _deviceState; }
            set
            {
                _deviceState = value;
                if (_deviceState)
                {
                    this.stateLight.State = UILightState.On;
                }
                else
                {
                    this.stateLight.State = UILightState.Off;

                }
            }
        }
        #endregion

        private string _variableName = "";
        [Browsable(true)]
        [Category("自定义属性")]
        [Description("获取变量名称")]
        public string VariableName
        {
            get { return _variableName; }
            set { _variableName = value; }
        }





    }
}
